<include file="Public:top" />
<!--头部 end-->
<script type="text/javascript" src="__PUBLIC__/js/ajaxfileupload.js"></script>
 <include file="Public:menu" /> 
 <!--菜单 end-->
<form  id='crewForm' >
			<div class="form-group">
                    <div class="label"><label for="title">修改科室</label></div>
                    <div class="field">
                        <input type="text" class="input"  name="title" size="20" value="{$result.title}" placeholder="" data-validate="required:请填写名称，建议在12字以内。" style="width:40%;" />
                    </div>
            </div>
            <div class="form-group">
                    <div class="label"><label for="title">排序</label></div>
                    <div class="field">
                        <input type="number" class="input"  name="order" size="20" value="{$result.order}" placeholder="请填写数字" style="width:20%;" />
                    </div>
            </div>

            <div class="form-group">
                <div class="label"><label for="title">是否显示</label></div>
                <div class="field">
                    <input type="number" class="input"  name="is_show" size="20" value="{$result.is_show}" placeholder="请填写数字" style="width:20%;" />
                    <p>1为显示；0为隐藏；</p>
                </div>
            </div>

            <div class="form-group">
                <div class="label"><label for="title">上级id</label></div>
                <div class="field">
                    <select id="$result"  name="pid">
                        <if condition="$f_pid['pid'] == null">
                            <option value="1">顶级</option>
                            <else />
                            <option value="{$f_pid['ty_id']}">{$f_pid['title']}</option>
                        </if>
                        <foreach name='results' item='v'>
                            <option value="{$v.ty_id}">{$v.title}</option>
                        </foreach>
                    </select>
                </div>
            </div>

            <div class="form-group">
                <div class="label"><label for="title">添加时间</label></div>
                <div class="field">
                    {$result.addtime}
                </div>
            </div>

                            <input type="hidden" name="ty_id" value="{$result.ty_id}">
       <div class="form-button" align="center"><button class="button bg-main" id="sure" type="submit">提交</button></div>

</form>


  <include file="Public:box" /> 
 <!--底部 end-->
 <script>


    //异步表单提交
        $('#sure').click(function(){

            $.post('/Console/type/doUpdate',$('form').serialize(),function(data){

                if ( data.status )
                {
                    layer.alert(data.info, 1);

                    //刷新当前页
                    location.href = "/Console/type";
                }
                else
                {

                    layer.alert(data.info);

                }

            },'json');

            return false;

        })





  

</script>